// Copyright 2022 jeff.li. and/or its affiliates.


#include <tbir/runtime/logging.h>
#include <tbir/runtime/registry.h>

namespace tbir::runtime {

    TBIR_REGISTER_GLOBAL("runtime.SetLoggingLevel").set_body([](PyArgs args) -> RTValue {
        MXCHECK_EQ(args.size(), 1) << "[SetLoggingLevel] Expect 1 arguments but get " << args.size();
        auto logging_level = args[0].As<int64_t>();
        SetLoggingLevel(logging_level);
        return None;
    });

    TBIR_REGISTER_GLOBAL("runtime.GetLoggingLevel").set_body([](PyArgs args) -> RTValue {
        MXCHECK_EQ(args.size(), 0) << "[GetLoggingLevel] Expect 0 arguments but get " << args.size();
        auto logging_level = GetLoggingLevel();
        return logging_level;
    });

}  // namespace tbir::runtime
